package cn.codergege.kotlinclass.entity

data class User(
    val name: String,
    val password: String,
    val nickName: String? = null
)

fun main(args: Array<String>) {
    val user1 = User("codergege", "123")
    val user2 = User("codergege", "123")
    println(user1) // 重载了 toString()
    println(user1 == user2)// 重载了 equals()
    val (name, pwd, nick) = user1 // 重载了 componentN() 用于解构赋值
    println("$name, $pwd, $nick")
}